<?php

class Student_gpaController extends Zend_Controller_Action
{

   // $user_id = Zend_Auth::getInstance()->getIdentity()->id;
    protected $user;

    public function init()
    {
        /* Initialize action controller here */
        $this->user = Zend_Auth::getInstance()->getIdentity()->id;
    }

    
    public function indexAction(){
       $this->view->title = "<b>Choose a Semester and Year</b><br><br>";
       $this->view->headTitle($this->view->title, 'PREPEND');

       $form = new Student_Form_newGPA();
        $form->setAction($this->getFrontController()->getBaseUrl() . '/student/gpa/view/id/'.$this->user);
    	$this->view->form = $form;
    }


    public function viewAction(){

        
       // $id = $this->_getParam('id');


         $semester = $this->_getParam('semester');
         $year = $this->_getParam('year');

        //print_r($id);
       // print_r($semester);
       // print_r($year);

         $getGPA = new Student_Model_DbTable_GPA();
         $values = $getGPA->GPA($this->user, $semester, $year);

         //$this->view->gpa = $values;

         //$this->view->values = $values;
         //print_r("MAH MAN".$values);
        //print_r($getGPA);
         //$this->view->grades = $getGPA;
         //$this->_redirect('/student/gpa/index');         
    }
    
}
